package com.csun.cmny.provider.device.watch.entity;

    /// <summary>
    ///  上行服务中心配置数据确认组包
    ///  关联下行 042
    ///  Upstream Service Center Configuration Data Confirmation Package
    ///  Associated downlink  042
    /// </summary>
    public class C043
    {
        /// <summary>
        /// 数据起封包 @B#@ 
        /// Start Fixed value :@B#@ 
        /// </summary>
        public String HeadCode = "@B#@";
        /// <summary>
        /// 协议版本号
        /// Protocol version number
        /// </summary>
        public String Protocol = null;
        /// <summary>
        /// 功能代码识别
        /// Function code
        /// </summary>
        public final String FunCode = "043";
        /// <summary>
        /// 国际移动设备身份码
        /// International Mobile Equipment Identity
        /// </summary>
        public String IMEI = null;
        /// <summary>
        /// 终端当前时间(年月日时分秒) yyyyMMddHHmmss
        /// The terminal current time ( format:yyyyMMddHHmmss)
        /// </summary>
        public String TerminalTime = null;
        /// <summary>
        /// 结尾封包 @E#@
        /// End packet @E#@
        /// </summary>
        public String FootCode = "@E#@";


        /// <summary>
        /// 初始化模型
        ///@B#@|01|043|111112222233333|20160715153805|@E#@
        /// </summary>
        /// <param name="cmdStr">命令代码</param>
        public C043(String cmdStr)
        {
        	String[] data = cmdStr.split("\\|");
            int dataLength = data.length;
            if (dataLength == 6 && "@B#@".equals(data[0]) && FunCode.equals(data[2]))
            {
                HeadCode = data[0];
                Protocol = data[1];
                IMEI = data[3];
                TerminalTime = data[4];
                FootCode = data[5];
            }

        }

        public  String ToString()
        {
        	String rString = HeadCode + "|";
            rString += Protocol + "|";
            rString += FunCode + "|";
            rString += IMEI + "|";
            rString += TerminalTime + "|";
            rString += FootCode;
            return rString;
        }
    }


